<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

namespace Index\Controller;

/**
 * Description of MessController
 *
 * @author gangguo
 */
class MessController extends CommonController{
    //put your code here
    private  $Message;
    protected $_needLogin = true;

    public function __construct() {
        parent::__construct();
        $this->Message = new \Common\Model\Message();
    }

    //章节报错
    public function getErrorArticle(){
        $article_id = I('request.article_id');
        if($article_id > 0){
            $Article = new \Common\Model\BookArticleModel();
            $article_name = $Article->getArticleName($article_id);
            $data = array('member_id'=>  $this->_id,'txt'=>'章节报错:'.$article_name);

        }
        return FALSE;
    }


    //求新书
    public function getNewBook(){
        $book_name = I('request.book_name');
        if(empty($book_name)){
            $data = array('member_id'=>  $this->_id,'txt'=>'添加新书:'.$book_name);
            return $this->Message->add($data);
        }
        return FALSE;
    }



}
